These are few objective type questions which i was not able to find the solution [closed]

Posted by Tarun on Stack Overflow See other posts from Stack Overflow or by Tarun
Published on 2010-05-16T11:30:16Z Indexed on 2010/05/16 11:40 UTC
Read the original article Hit count: 1252

Filed under:
|
|
|
|
1.  Which of the following advantages does System.Collections.IDictionaryEnumerator provide over System.Collections.IEnumerator?


    a.  It adds properties for direct access to both the Key and the Value
    b.  It is optimized to handle the structure of a Dictionary.
    c.  It provides properties to determine if the Dictionary is enumerated in Key or Value order
    d.  It provides reverse lookup methods to distinguish a Key from a specific Value

2.  When Implementing System.EnterpriseServices.ServicedComponent derived classes, which of the following statements are true?


    a.  Enabling object pooling requires an attribute on the class and the enabling of pooling in the COM+ catalog.
    b.  Methods can be configured to automatically mark a transaction as complete by the use of attributes.
    c.  You can configure authentication using the AuthenticationOption when the ActivationMode is set to Library.
    d.  You can control the lifecycle policy of an individual instance using the SetLifetimeService method.

3.  Which of the following are true regarding event declaration in the code below?

class Sample
{
event MyEventHandlerType MyEvent;
}


    a.  MyEventHandlerType must be derived from System.EventHandler or System.EventHandler<TEventArgs>
    b.  MyEventHandlerType must take two parameters, the first of the type Object, and the second of a class derived from System.EventArgs
    c.  MyEventHandlerType may have a non-void return type
    d.  If MyEventHandlerType is a generic type, event declaration must use a specialization of that type.
    e.  MyEventHandlerType cannot be declared static

4.  Which of the following statements apply to developing .NET code, using .NET utilities that are available with the SDK or Visual Studio?


    a.  Developers can create assemblies directly from the MSIL Source Code.
    b.  Developers can examine PE header information in an assembly.
    c.  Developers can generate XML Schemas from class definitions contained within an assembly.
    d.  Developers can strip all meta-data from managed assemblies.
    e.  Developers can split an assembly into multiple assemblies.

5.  Which of the following characteristics do classes in the System.Drawing namespace such as Brush,Font,Pen, and Icon share?


    a.  They encapsulate native resource and must be properly Disposed to prevent potential exhausting of resources.
    b.  They are all MarshalByRef derived classes, but functionality across AppDomains has specific limitations.
    c.  You can inherit from these classes to provide enhanced or customized functionality

6.  Which of the following are required to be true by objects which are going to be used as keys in a System.Collections.HashTable?


    a.  They must handle case-sensitivity identically in both the GetHashCode() and Equals() methods.
    b.  Key objects must be immutable for the duration they are used within a HashTable.
    c.  Get HashCode() must be overridden to provide the same result, given the same parameters, regardless of reference equalityl unless the HashTable constructor is provided with an IEqualityComparer parameter.
    d.  Each Element in a HashTable is stored as a Key/Value pair of the type System.Collections.DictionaryElement
    e.  All of the above

7.  Which of the following are true about Nullable types?


    a.  A Nullable type is a reference type.
    b.  A Nullable type is a structure.
    c.  An implicit conversion exists from any non-nullable value type to a nullable form of that type.
    d.  An implicit conversion exists from any nullable value type to a non-nullable form of that type.
    e.  A predefined conversion from the nullable type S? to the nullable  type T? exists if there is a predefined conversion from the non-nullable type S to the non-nullable type T
8.  When using an automatic property, which of the following statements is true?


    a.  The compiler generates a backing field that is completely inaccessible from the application code.
    b.  The compiler generates a backing field that is a private instance member with a leading underscore that can be programmatically referenced.
    c.  The compiler generates a backing field that is accessible via reflection
    d.  The compiler generates a code that will store the information separately from the instance to ensure its security.


9.  Which of the following does using Initializer Syntax with a collection as shown below require?

CollectionClass numbers = new CollectionClass { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };


    a.  The Collection Class must implement
System.Collections.Generic.ICollection<T>
    b.  The Collection Class must implement
System.Collections.Generic.IList<T>
    c.  Each of the Items in the Initializer List will be passed to the Add<T>(T item) method
    d.  The items in the initializer will be treated as an IEnumerable<T> and passed to the collection constructor+K110


10. What impact will using implicitly typed local variables as in the following example have?
var sample = "Hello World";


    a.  The actual type is determined at compilation time, and has no impact on the runtime
    b.  The actual type is determined at runtime, and late binding takes effect
    c.  The actual type is based on the native VARIANT concept, and no binding to a specific type takes place.
    d.  "var" itself is a specific type defined by the framework, and no special binding takes place

11. Which of the following is not supported by remoting object types?


    a.  well-known singleton
    b.  well-known single call
    c.  client activated
    d.  context-agile

 
12. In which of the following ways do structs differ from classes?


    a.  Structs can not implement interfaces
    b.  Structs cannot inherit from a base struct
    c.  Structs cannot have events interfaces
    d.  Structs cannot have virtual methods

13. Which of the following is not an unboxing conversion?


    a.  void Sample1(object o)
{
  int i = (int)o;
}
    b.  void Sample1(ValueType vt)
{
   int i = (int)vt;
}
    c.  enum E { Hello, World} 
void Sample1(System.Enum et)
{
   E  e = (E) et;
}
    d.  interface I { int Value { get; set; } }
void Sample1(I vt)
{
   int i = vt.Value;
}
    e.  class C { public int Value { get; set; } }
void Sample1(C vt)
{
    int i = vt.Value;
}

14. Which of the following are characteristics of the System.Threading.Timer class?


    a.  The method provided by the TimerCallback delegate will always be invoked on the thread which created the timer.
    b.  The thread which creates the timer must have a message processing loop (i.e. be considered a UI thread)
    c.  The class contains protection to prevent reentrancy to the method provided by the TimerCallback delegate  
    d.  You can receive notification of an instance being Disposed by calling an overload of the Dispose method.


15. What is the proper declaration of a method which will handle the following event?

Class MyClass
{
public event EventHandler MyEvent;
}


    a.  public void A_MyEvent(object sender, MyArgs e)
{
}
    b.  public void A_MyEvent(object sender, EventArgs e)
{
}
    c.  public void A_MyEvent(MyArgs e)
{
}
    d.  public void A_MyEvent(MyClass sender,EventArgs e)
{
}

16. Which of the following scenarios are applicable to Window Workflow Foundation?


    a.  Document-centric workflows
    b.  Human workflows
    c.  User-interface page flows
    d.  Builtin support for communications across multiple applications and/or platforms
    e.  All of the above
17. When using an automatic property, which of the following statements is true?


    a.  The compiler generates a backing field that is completely inaccessible from the application code.
    b.  The compiler generates a backing field that is a private instance member with a leading underscore that can be programmatically referenced.
    c.  The compiler generates a backing field that is accessible via reflection
    d.  The compiler generates a code that will store the information separately from the instance to ensure its security.


18  While using the capabilities supplied by the System.Messaging classes, which of the following are true?


    a.  Information must be explicitly converted to/from a byte stream before it uses the MessageQueue class
    b.  Invoking the MessageQueue.Send member defaults to using the System.Messaging.XmlMessageFormatter to serialize the object.
    c.  Objects must be XMLSerializable in order to be transferred over a MessageQueue instance.
    d.  The first entry in a MessageQueue must be removed from the queue before the next entry can be accessed
    e.  Entries removed from a MessageQueue within the scope of a transaction, will be pushed back into the front of the queue if the transaction fails.



19. Which of the following are true about declarative attributes?


    a.  They must be inherited from the System.Attribute.
    b.  Attributes are instantiated at the same time as instances of the class to which they are applied.
    c.  Attribute classes may be restricted to be applied only to application element types.
    d.  By default, a  given attribute may be applied multiple times to the same application element.

20. When using version 3.5 of the framework in applications which emit a dynamic code, which of the following are true?


    a.  A Partial trust code can not emit and execute a code
    b.  A Partial trust application must have the SecurityCriticalAttribute attribute have called  Assert ReflectionEmit permission
    c.  The generated code no more permissions than the assembly which emitted it.
    d.  It can be executed by calling
System.Reflection.Emit.DynamicMethod(
    string name,
    Type returnType,
    Type[] parameterTypes
) without any special permissions


Within Windows Workflow Foundation, Compensating Actions are used for:


    a.  provide a means to rollback a failed transaction
    b.  provide a means to undo a successfully committed transaction later
    c.  provide a means to terminate an in process transaction
    d.  achieve load balancing by adapting to the current activity

21. What is the proper declaration of a method which will handle the following event?

Class MyClass
{
public event EventHandler MyEvent;
}


    a.  public void A_MyEvent(object sender, MyArgs e)
{
}
    b.  public void A_MyEvent(object sender, EventArgs e)
{
}
    c.  public void A_MyEvent(MyArgs e)
{
}
    d.  public void A_MyEvent(MyClass sender,EventArgs e)
{
}

22. Which of the following controls allows the use of XSL to transform XML content into formatted content?


    a.  System.Web.UI.WebControls.Xml  
    b.  System.Web.UI.WebControls.Xslt
    c.  System.Web.UI.WebControls.Substitution
    d.  System.Web.UI.WebControls.Transform


23. To which of the following do automatic properties refer?


    a.  You declare (explicitly or implicitly) the accessibility of the property and get and set accessors, but do not provide any implementation or backing field
    b.  You attribute a member field so that the compiler will generate get and set accessors
    c.  The compiler creates properties for your class based on class level attributes
    d.  They are properties which are automatically invoked as part of the object construction process





24. Which of the following are true about Nullable types?


    a.  A Nullable type is a reference type.
    b.  An implicit conversion exists from any non-nullable value type to a nullable form of that type.
    c.  A predefined conversion from the nullable type S? to the nullable type T? exists if there is a predefined conversion from the non-nullable type S to the non-nullable type T

25. When using an automatic property, which of the following statements is true?


    a.  The compiler generates a backing field that is completely inaccessible from the application code.
    b.  The compiler generates a backing field that is accessible via reflection.
    c.  The compiler generates a code that will store the information separately from the instance to ensure its security.

26. When using an implicitly typed array, which of the following is most appropriate?


    a.  All elements in the initializer list must be of the same type.
    b.  All elements in the initializer list must be implicitly convertible to a known type which is the actual type of at least one member in  the initializer list
    c.  All elements in the initializer list must be implicitly convertible to common type which is a base type of the items actually in the list


27.  Which of the following is false about anonymous types?


    a.  They can be derived from any reference type.
    b.  Two anonymous types with the same named parameters in the same order declared in different classes have the same type.
    c.  All properties of an anonymous type are read/write.



28. Which of the following are true about Extension methods.


    a.  They can be declared either static or instance members
    b.  They must be declared in the same assembly (but may be in different source files)
    c.  Extension methods can be used to override existing instance methods
    d.  Extension methods with the same signature for the same class may be declared in multiple namespaces without causing compilation errors

© Stack Overflow or respective owner

Related posts about homework

Related posts about c#